"""
题目二:【练习】猜拳游戏
编写一个Python程序，实现一个简单的猜拳游戏。玩家和电脑各自选择石头、剪刀或布，根据规则判断胜负关系，并输出比赛结果
"""


import random
def guess_game():
    # 玩家猜拳
    player = input('请出石头/剪刀/布:')
    # 电脑猜拳
    computer = random.choice(["石头", "剪刀", "布"])
    # 玩家和电脑猜拳结果一致
    if player == computer:
        print(f'玩家出的{player},电脑出的{computer},双方打成平手!')
    # 玩家赢的条件
    elif (player == '石头' and computer == '剪刀') or (player == '剪刀' and computer == '布') or (player == '布' and computer == '石头'):
        print(f'玩家出的{player},电脑出的{computer},最终玩家胜')
    # 电脑赢的条件
    else:
        print(f'玩家出的{player},电脑出的{computer},最终电脑胜')


guess_game()